package practice.sort.compare;

import practice.sort.Sort;

/**
 * @Description:
 * @Author Ammar
 * @Create 2023/8/9 19:57
 */
public class SelectionSort extends Sort {
    @Override
    public void sort() {
        for (int i = nums.length - 1; i >= 1; i--) {
            int max = i;
            for (int j = 0; j < i; j++) {
                if (nums[max] < nums[j]) max = j;
            }
            swap(max, i);
        }
    }
}
